Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Ruby 3 / Rails 7 and remove node.js dependency #55

Merged
merged 8 commits into from
Jun 3, 2022
Merged

Conversation

oneiros
Copy link
Collaborator

@oneiros oneiros commented May 4, 2022

As discussed in #34 this brings hdm to the current versions of ruby and rails.

Furthermore I removed the old webpacker-based asset handling and replaced it with a combination of importmaps-rails and dartsass-rails.

The former allows serving unbundled JS in a clever way, the latter includes a standalone executable of a current, maintained SCSS implementation. Taken together, this means hdm no longer requires node.js.

I tried to adjust the documentation and Dockerfile accordingly, but I might have missed something. @rwaffen: I suspect the Dockerfile can be simplified even more now, but I do not understand what is going on 100%, so you might want to have another look.

The biggest change when it comes to day to day work with the application, is that for development purposes it no longer suffices to run rails server. Instead one can use the bin/dev script, that is a small wrapper around foreman (the process manager, not the devops tool). foreman simply starts processes defined in Procfile. Besides the rails server there is now also a command to start a sass process that watches for changes to .scss files and compiles them if needed.

This is for development purposes only. In a production installation, nothing should change. There, assets need not be compiled on-the-fly, but with the bin/rails assets:precompile task once for every deployment/update. Also, for production purposes, the application should run in the production rails environment. This is either achieved by starting the server with -e production or via setting the RAILS_ENV environment variable.

I am pretty sure we discussed this before, but I could find neither in the existing documentation and scripts. Before this change, this was not a huge issue, but when this is merged, it will lead to problems.

oneiros added 7 commits June 2, 2022 09:34
This is an intermediate step towards ruby 3 / rails 7.
Also upgrade other dependencies as much as possible.

Tests are green, but nothing else has been checked so
far.

Next stop: Ruby 3.
Again, tests are green, nothing else has been checked.
This uses the `importmap-rails` and `dartsass-rails` gems
to get rid of node/yarn.

Also migrates from turbolinks to its official successor
turbo.

All webpacker/node/yarn related files should have been
removed, but I might have missed some.
This lets rubocop ignore binstubs, that are generated
automatically, and configuration files, that due to their
nature as such will probably always trigger one or more
cops.
Rails 7 simplifies usage of custom configuration loaded
with `config_for`. This change makes use of these
simplifications.
@rwaffen rwaffen merged commit 4541585 into main Jun 3, 2022
@rwaffen rwaffen deleted the issue-34 branch June 3, 2022 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants